/**
 *@auther: tang
 *@Date: 2020-11-16
 *Project: group-booking-shop-manage-system
 */

import React from "react"
import {
    Row,
    Col,
    Form,
    Input,
    Button,
    Radio
} from 'antd';

class InfoSetting extends React.Component {
    constructor(props) {
        super(props);
        this.state={
            initialValues:{
                balance: null,
                editorder: null,
                integral: null,
                minmoney: null,
                subrepository: null,
                ticket: null
            }
        }
    }
    formSubmitHandle(info){
        console.log(info)
    }
    render() {
        return (
            <div>
                <Form
                    labelCol={{
                        span: 4,
                    }}
                    wrapperCol={{
                        span: 20,
                    }}
                    layout="horizontal"
                    size="default"
                    initialValues={this.state.initialValues}
                    onFinish={this.formSubmitHandle.bind(this)}
                >
                    <Form.Item label="是否使用积分" name="integral">
                        <Radio.Group>
                            <Radio value={false}>不使用</Radio>
                            <Radio value={true}>使用</Radio>
                        </Radio.Group>
                    </Form.Item>
                    <Form.Item label="是否使用优惠券" name="ticket">
                        <Radio.Group>
                            <Radio value={false}>不使用</Radio>
                            <Radio value={true}>使用</Radio>
                        </Radio.Group>
                    </Form.Item>
                    <Form.Item label="是否使用余额" name="balance">
                        <Radio.Group>
                            <Radio value={false}>不使用</Radio>
                            <Radio value={true}>使用</Radio>
                        </Radio.Group>
                    </Form.Item>
                    <Form.Item label="操作订单时" name="editorder">
                        <Radio.Group>
                            <Radio value={false}>无需填写备注</Radio>
                            <Radio value={true}>必须填写备注</Radio>
                        </Radio.Group>
                    </Form.Item>
                    <Form.Item label="购物最小金额" >
                        <Form.Item name="minmoney">
                            <Input />
                        </Form.Item>
                        <p>达到此购物金额，才能提交订单</p>
                    </Form.Item>
                    <Form.Item label="减少库存时机" name="subrepository">
                        <Radio.Group>
                            <Radio value={false}>付款时</Radio>
                            <Radio value={true}>成团时</Radio>
                        </Radio.Group>
                    </Form.Item>
                    <Form.Item >
                        <Row>
                            <Col span={20}/>
                            <Col span={4}>
                                <Button htmlType="submit" type="primary">提交</Button>
                            </Col>
                        </Row>
                    </Form.Item>
                </Form>
            </div>
        )
    }
}

export {InfoSetting as default}


